package com.hospital.wx.controller.form;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

@Data
@Schema(description = "患者挂号表单")
public class CreateAppointmentOrderForm {

    /*
    *
                * {
              "workPlanId": 1,
              "scheduleId": 2,
              "appointmentDate": "2025-04-19",
              "doctorId": 1,
              "deptSubId": 2,
              "deptName": "1",
              "amount": "30",
              "timeSlot": "2",
              "doctorName": "张医生",
              "visitType": "门诊就诊"
              "patientId": 21,
              "patientName": "快乐就去敲代码吧."
            }
    *
    * */

    @NotNull(message = "workPlanId不能为空")
    @Min(value = 1, message = "workPlanId不能小于1")
    private Integer workPlanId;

    @NotNull(message = "scheduleId不能为空")
    @Min(value = 1, message = "scheduleId不能小于1")
    private Integer scheduleId;

    @NotNull(message = "appointmentDate不能为空")
    private Date appointmentDate; // 日期类型使用 @NotNull

    @NotNull(message = "doctorId不能为空")
    @Min(value = 1, message = "doctorId不能小于1")
    private Integer doctorId; // 建议使用包装类

    @NotNull(message = "deptSubId不能为空")
    @Min(value = 1, message = "deptSubId不能小于1")
    private Integer deptSubId; // 建议使用包装类

    @NotNull(message = "amount不能为空")
    private BigDecimal amount; // 金额使用 BigDecimal（或 Integer）

    @NotBlank(message = "timeSlot不能为空")
    private String timeSlot; // 字符串类型，移除 @Range 注解

    @NotBlank(message = "doctorName不能为空")
    private String doctorName;

    @NotBlank(message = "visitType不能为空")
    private String visitType;

    @NotNull(message = "患者ID不能为空")
    private Integer patientId; // 改为包装类 Integer

    @NotBlank(message = "患者名称不能为空")
    private String patientName;



}
